﻿@using CoralNode.Core.Entity.Enums
@using CoralNode.MvcClient.Helper
@using Coralcode.Utils.Basic
@model CoralNode.Core.Entity.Domains.Site.SiteDomain

@{
    ViewBag.Title = "Edit";
}
@Html.IncludePage("CoralAdmin/site", "_Left", new { current = "site" })
<div id="pbody">
    <div class="extra">
        <div class="pbody_top">
            <span class="ico ico_setting_system"></span><span class="t t_c">站点管理&nbsp;&nbsp;/&nbsp;&nbsp;<b
                class=" t_small f_no">添加网站</b></span>
        </div>
        <div id="main">
            <div class="local">
                <a href="/m/site" class="ico ico_back btn"></a>
            </div>
            <div class="content_tab extra_normal">
                <div class="tablist extra_normal" data-js="tab">
                    <a href="#">主要信息</a>
                    <a href="#">详细信息</a>
                </div>
            </div>
            <form id="spform" action="/m/site/createSite" method="post" enctype="multipart/form-data">
                <div class="pt_3 js_tabcnt">
                    <div class="table_form form_main ">
                        <div class="pl_2 pb_3">
                            <table>
                                <tbody>
                                    <tr>
                                        <th width="60">站点名称<span class="rq">*</span></th>
                                        <td>
                                            @Html.TextBoxFor(m => m.Name, new { @class = "text w_37 required" })
                                            <div class="exp ml_1">4-16个字符，支持英文小写、数字、下划线</div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>域名主机<span class="rq">*</span></th>
                                        <td>@Html.TextBoxFor(m => m.Hosts, new { @class = "text w_37 required" })
                                            <div class="exp ml_1">4-16个字符，支持英文小写、数字、下划线</div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th width="60">根目录<span class="rq">*</span></th>
                                        <td>
                                            @Html.TextBoxFor(m => m.Root, new { @class = "text w_37 required" })
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="60">LOGO</td>
                                        <td>
                                            @Html.HiddenFor(m=>m.Logo)
                                            <ul class="list_img" href="/m/common/upload" data-js="listimg">
                                                <li class="btn li_add js_openuploader" data-meta="{data:'{module:\'qualification/Thumb\'}',multi:false,method:'add',type:'image'}">
                                                    <span class="ico ico_upload_image"></span>
                                                </li>
                                            </ul>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>站点主题</th>
                                        <td>
                                            <div class="slt js-select" name="ThemeCode" wd="264" swd="220">
                                                <div class="curr"><span></span></div>
                                                <div class="show">
                                                    <ul>
                                                     @foreach (var item in @ViewBag.ThemesList) {
                                                         if (Model.ThemeCode == @item.Code) {
                                                             <li selected="selected" val="@item.Code"><a>@item.Name</a></li>
                                                         } else {
                                                             <li  val="@item.Code"><a>@item.Name</a></li>
                                                         }
                                                     }
                                                    </ul>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>站点语言</th>
                                        <td>
                                            <div class="slt js-select" name="LangCode" wd="264" swd="220">
                                                <div class="curr"><span></span></div>
                                                <div class="show">
                                                    <ul>
                                                        @foreach (var item in @ViewBag.LangList)
                                                        {
                                                            if (Model.LangCode == @item.Code)
                                                            {
                                                                <li selected="selected" val="@item.Code"><a>@item.Area</a></li>
                                                            } else {
                                                                <li  val="@item.Code"><a>@item.Area</a></li>
                                                            }
                                                        }
                                                    </ul>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                     <tr>
                                        <th>是否开启微信</th>
                                        <td>
                                            <label class="mr_2">
                                                <input name="HasWechat"  class="radio" @(Model.HasWechat?"checked":string.Empty) type="radio" value="true"><span>是</span></label>
                                            <label class="mr_2">
                                                            <input name="HasWechat"  class="radio" @(!Model.HasWechat?"checked":string.Empty) type="radio" value="false"><span>否</span></label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>站点状态</th>
                                        <td>
                                            <div class="slt js-select" name="Status" wd="264" swd="220">
                                                <div class="curr"><span></span></div>
                                                <div class="show">
                                                    <ul>
                                                     @foreach (var item in @ViewBag.SiteStatusList)
                                                     {
                                                         if (Model.Status == @item.Value)
                                                         {
                                                             <li selected="selected" val="@item.Value"><a>@item.Key</a></li>
                                                         }
                                                         else
                                                         {
                                                             <li  val="@item.Value"><a>@item.Key</a></li>
                                                         }
                                                     }
                                                    </ul>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>字符集</th>
                                        <td>
                                            <div class="slt js-select" name="Charset" wd="264" swd="220">
                                                <div class="curr"><span></span></div>
                                                <div class="show">
                                                    <ul>
                                                        @foreach (var item in @ViewBag.SiteCharsetList)
                                                        {
                                                            if (Model.Charset == @item.Value)
                                                            {
                                                                <li selected="selected" val="@item.Value"><a>@item.Key</a></li>
                                                            }
                                                            else
                                                            {
                                                                <li  val="@item.Value"><a>@item.Key</a></li>
                                                            }
                                                        }
                                                    </ul>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                            <th>管理后台</th>
                                            <td>
                                                <div class="slt js-select" name="ManageSiteId" wd="264" swd="220">
                                                    <div class="curr"><span></span></div>
                                                    <div class="show">
                                                        <ul>
                                                            <li  val="0"><a>无</a></li>
                                                            @foreach (var item in ViewBag.ManageSiteList) {
                                                                if (Model.ManageSiteId == @item.Id) {
                                                                    <li selected="selected" val="@item.Id"><a>@item.Name</a></li>
                                                                } else {
                                                                    <li  val="@item.Id"><a>@item.Name</a></li>
                                                                }
                                                            }
                                                        </ul>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="table_form form_main ">

                        <div class="pl_2 pb_3">
                            <table data-js="tabCnt">
                                <tbody>
                                    <tr>
                                        <th width="60">口号</th>
                                        <td>@Html.TextBoxFor(m => m.Slogan, new { @class = "text w_37" })</td>
                                    </tr>
                                    <tr>
                                        <th width="60">作者</th>
                                        <td>@Html.TextBoxFor(m => m.Author, new { @class = "text w_37" })</td>
                                    </tr>
                                    <tr>
                                        <th>版权</th>
                                        <td>@Html.TextBoxFor(m => m.Copyright, new { @class = "text w_37" })</td>
                                    </tr>
                                    <tr>
                                        <th width="60">ICP</th>
                                        <td>@Html.TextBoxFor(m => m.Icp, new { @class = "text w_37" })</td>
                                    </tr>
                                    <tr>
                                        <th>地区</th>
                                        <td>@Html.TextBoxFor(m => m.Area, new { @class = "text w_37" })</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="submitbox p_2 extra_normal">
                    <input type="submit" class="btn_1" value="提    交" />
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('.nav_left_style2').find('li').eq(0).addClass('current');
    });
</script>
